package com.kgc.scd.controller;

import com.kgc.scd.service.ShopGoodsServerService;
import com.kgc.scd.vo.ShopGoodsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created On : 2022/11/17.
 * <p>
 * Author : Administrator
 * <p>
 * Description: ShopGoodsServerController
 */
@Slf4j
@RestController
@Api(tags = "商品接口")
public class ShopGoodsServerController {

    @Autowired
    private ShopGoodsServerService shopGoodsServerService;

    @GetMapping("/getShopGoodsById")
    @ApiOperation(value = "通过pid获取商品信息")
    public ShopGoodsVO getShopGoodsById(String pid){


        return shopGoodsServerService.getShopGoodsById(pid);
    }

    @GetMapping("/judegeGoodNumberEnough")
    public boolean judegeGoodNumberEnough(String pid, Integer number){
        return shopGoodsServerService.judegeGoodNumberEnough(pid,number);
    }
}
